package com.epam.Fish;

public class Guppy extends Fish {

    public Guppy(String name, int size, double price, int numberOfFins) {
        super(name, size, price);

        this.numberOfFins = numberOfFins;
    }

    private int numberOfFins;

    public int getNumberOfFins() {
        return numberOfFins;
    }

    public void setNumberOfFins(int numberOfFins) {
        if(numberOfFins >= 2){
            this.numberOfFins = numberOfFins;
        }
    }

    @Override
    public void eat() {
        System.out.println("Guppy eating");
        hunger--;
        System.out.println("Hunger: " + hunger);
    }

    @Override
    public void swim() {
        System.out.println("Guppy swimming");
        hunger++;
        System.out.println("Hunger: " + hunger);
    }

    @Override
    public String toString() {
        return "Guppy [ Name: "+getName()+"; Price: "+getPrice()+"; Size:"+ getSize()+"; Number of fins: "+
                getNumberOfFins()+"]";
    }


}
